{
  "properties" : { },
  "id" : "copy1741269861893d7901",
  "script" : null,
  "groupId" : "0e4db7db28de4bbcad440c21a3c775e1",
  "name" : "查询(我的)",
  "createTime" : null,
  "updateTime" : 1741269982391,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "可辉",
  "path" : "query/user",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"msg\": \"系统内部出现错误\"\n}",
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================

import 'org.activiti.engine.TaskService' as taskService;
import 'org.activiti.engine.RuntimeService' as runtimeService;
import 'com.wiwf.model.security.service.SysTokenService' as sysTokenService;
import org.activiti.engine.task.Task;
import log;

var user = sysTokenService.getTokenUser(cookie[sysTokenService.getTokenKey()]);
var roleCode = user.roleCode;
var userId = user.userId+"";

var list = taskService.createTaskQuery()
                .taskAssignee(userId)
                .list();
var resList = [];
for (item in list) {
    var formData = runtimeService.getVariables(item.getProcessInstanceId());

    resList.add({
        id: item.getId(), name: item.getName(), description: item.getDescription(), priority: item.getPriority(), 
        owner: item.getOwner(), assignee: item.getAssignee(), formData: formData,
        processInstanceId: item.getProcessInstanceId(), executionId: item.getExecutionId(), 
        processDefinitionId: item.getProcessDefinitionId(), createTime: item.getCreateTime(), taskDefinitionKey: item.getTaskDefinitionKey(),
        dueDate: item.getDueDate(),
        category: item.getCategory(),
        parentTaskId: item.getParentTaskId(), tenantId: item.getTenantId(),
        formKey: item.getFormKey(),
        taskLocalVariables: item.getTaskLocalVariables(),
        processVariables: item.getProcessVariables(),
        claimTime: item.getClaimTime(), businessKey: item.getBusinessKey(),
        delegationState: item.getDelegationState(), appVersion: item.getAppVersion()
    });
}


return resList;